package jpavlich.cardsorter.action;

import java.io.Serializable;

import fr.inria.zvtm.animation.Animation;

public abstract class Action<T extends Action<?>> implements Cloneable, Serializable {
	protected transient boolean recordable=true;
	
	protected long startTime;
	protected long duration;

	abstract void execute();
	abstract void undo();
	
	public Action() {
	}
	
	public abstract Animation createAnimation();
	
	public void setTime(long startTime, long duration) {
		this.startTime = startTime;
		this.duration = duration;
	}
	
	public abstract T clone();
	public long getStartTime() {
		return startTime;
	}
	public long getDuration() {
		return duration;
	}
	@Override
	public String toString() {
		return "Action [recordable=" + recordable + ", startTime=" + startTime + ", duration=" + duration
				+ "]";
	}
	
	protected ResourceManager getResourceManager() {
		return ResourceManager.INSTANCE;
	}
	
}
